<template>
    <div class="box">
        <div class="banner">
            <div class="iconWrap">
                <i class="u-icon u-icon-hd-miniOpenAppClose close"></i>
            </div>
            <!-- <div class="imgWrap">
                <img src="https://yanxuan.nosdn.127.net/static-union/16607924415e76bf.png?type=webp&imageView&thumbnail=750x0&quality=75"
                    alt="">
            </div> -->
        </div>

        <!-- 用户信息 -->
        <div class="profile">
            <div class="row">
                <div class="left">
                    <img src="//yanxuan.nosdn.127.net/8945ae63d940cc42406c3f67019c5cb6.png" alt="" class="avatar">
                    <div class="info">
                        <p class="nickName">用户5463464</p>
                        <div>
                            <span class='memberTitle0'>普通用户</span>
                        </div>
                    </div>
                </div>
                <div class="right">
                    <a href="https://m.you.163.com/lead/newIndex?qrType=3&defaultTab=1&_stat_referer=userPage"><i
                            class="icon-normal u-icon-ucenter-qrCodeInUcenter"></i>
                    </a>
                    <div class="supermcEntrance">
                        <i class="u-icon u-icon-ucenter-supermember"></i>
                        <div class="word">
                            <div class="line1">Pro会员</div>
                            <div class="line2">
                                立即开通
                                <i class="u-icon-ucenter-arrow"></i>
                            </div>
                        </div>

                    </div>
                </div>

            </div>

        </div>
        <!-- 我的资产 -->
        <div class="myassets">
            <h2 class="tt">我的资产</h2>
            <div class="assetslist">
                <div class="assetsitem">
                    <p class="assetCount">
                        <span class="unit">￥</span>
                        <span class="value">
                            0
                            <span class="redDot"></span>
                        </span>
                    </p>
                    <p class="assetName">余额</p>
                </div>
                <div class="assetsitem">
                    <p class="assetCount">
                        <span class="unit"></span>
                        <span class="value">0</span>
                    </p>
                    <p class="assetName">红包</p>
                </div>
                <div class="assetsitem">
                    <p class="assetCount">
                        <span class="unit"></span>
                        <span class="value">0</span>
                    </p>
                    <p class="assetName">优惠券</p>
                </div>
                <div class="assetsitem">
                    <p class="assetCount">
                        <span class="unit"></span>
                        <span class="value">0</span>
                    </p>
                    <p class="assetName">积分</p>
                </div>
                <div class="assetsitem">
                    <p class="assetCount">
                        <span class="unit"></span>
                        <span class="value">0</span>
                    </p>
                    <p class="assetName">礼品卡</p>
                </div>
            </div>
        </div>
        <!-- 订单列表 -->
        <div class="personal_center">
            <van-grid :column-num="3" icon-size="25px">
              <van-grid-item icon="description" text="我的订单" icon-color="#9b9b9b"
                style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="user-circle-o" text="账号管理" icon-color="#9b9b9b"
                style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="phone-o" text="我的手机号" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="calendar-o" text="周六一起拼" icon-color="#9b9b9b"
                style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="after-sale" text="售后服务" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="photo-o" text="邀请返利" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="bag-o" text="优先购" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="gold-coin-o" text="积分中心" icon-color="#9b9b9b"
                style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="diamond-o" text="会员俱乐部" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="location-o" text="地址管理" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="shield-o" text="支付安全" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="service-o" text="帮助与客服" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="records" text="意见反馈" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
              <van-grid-item icon="photo-o" text="我的竞拍" icon-color="#9b9b9b" style="height: 90px;border:1px solid #e3e3e3" />
            </van-grid>
      
          </div>
        <!-- 退出登录 -->
        <div class="row">
            <button class="button" @click="logout">退出登录</button>
        </div>
    </div>
</template>

<script setup lang="ts">
import { getLogout } from '@/api/login'
import { useRouter } from 'vue-router'
import { showConfirmDialog } from 'vant';
import {ref} from 'vue'
const token = ref(localStorage.getItem('token'))
 

const router = useRouter()// 路由信息对象
const logout = () => {
    showConfirmDialog({
        message:
            '退出登陆',
    }).then(() => {
        const result = getLogout()
        localStorage.removeItem('token');
        router.push('/')
    })
}
</script>

<style lang="scss" scoped>
.box {
    .iconWrap {
        position: absolute;
        height: 100%;
        left: 0;
        top: 0;
        z-index: 2;

        .u-icon-hd-miniOpenAppClose {
            background-image: url(//yanxuan-static.nosdn.127.net/hxm/tetris/common-mobile/sprite/hd.png);
            display: inline-block;
            vertical-align: middle;
            background-size: 2.38rem 2.03rem;
            width: 19px;
            height: 19px;
            background-position: -0.5rem -1.55rem;
        }


    }

    .banner {
        .imgWrap {
            height: 52px;

            img {
                width: 100%;
                height: 100%;
            }

        }
    }

    //用户信息
    .profile {
        height: 135px;
        background-image: url(https://yanxuan.nosdn.127.net/5905098f74e04c39fa5e76ebb9ff591b.png);
        background-size: 100%;
        background-position: bottom;
        padding-left: 15px;
        position: relative;

        .row {
            display: flex;
            -webkit-box-align: center;
            align-items: center;

            .left {
                display: flex;
                flex-wrap: wrap;
                -webkit-box-pack: start;
                justify-content: flex-start;
                justify-content: flex-start;
                padding: 32px 0;
                width: 240.5px;

                img {
                    vertical-align: middle;
                    width: 71px;
                    height: 71px;
                    border-radius: 50%;
                }

                .info {
                    -webkit-box-flex: 1;
                    flex: 1;
                    margin-left: 0.3rem;
                    line-height: 1;
                    overflow: hidden;

                    .nickName {
                        color: #fff;
                        font-size: 18px;
                        line-height: 1.2;
                        text-align: left;
                        margin-bottom: 0.1rem;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                        overflow: hidden;
                    }

                    .memberTitle0 {
                        color: #fff;
                        font-size: .28rem;
                        vertical-align: middle;
                    }

                }

            }

            .right {

                width: 119.5px;
                padding-left: 8.5px;
                height: 100%;

                .u-icon-ucenter-qrCodeInUcenter {
                    background-image: url(//yanxuan-static.nosdn.127.net/hxm/yanxuan-mall-wap/assets/img/ucenter-11eb865ad061b2dd08d2ec54d87461d6.png);
                    display: inline-block;
                    vertical-align: middle;
                    background-size: 3.78rem 3.7rem;
                    ;
                    position: absolute;
                    right: 10px;
                    top: 30px;
                    width: 32px;
                    height: 32px;
                }

                .supermcEntrance {
                    margin-top: 52px;
                    padding: 0 10px 0 5px;
                    white-space: nowrap;
                    height: 42px;
                    border-top-left-radius: 50px;
                    border-bottom-left-radius: 50px;
                    overflow: hidden;
                    animation: shake 1s linear 3;
                    background-image: linear-gradient(180deg, #574e44, #0e0e0e);

                    .u-icon-ucenter-supermember {
                        background-image: url(//yanxuan-static.nosdn.127.net/hxm/yanxuan-mall-wap/assets/img/ucenter-11eb865ad061b2dd08d2ec54d87461d6.png);
                        display: inline-block;
                        vertical-align: middle;
                        width: 21px;
                        height: 21px;
                        background-size: 3.21rem 2.78rem;
                        background-position: -0.58rem -0.66rem;
                        margin: auto 4.5px;
                    }

                    .word {
                        display: inline-block;
                        padding: 5px 0;
                        color: #ede7db;
                        vertical-align: middle;

                        .line1 {
                            font-size: 12px;
                            line-height: 18px;
                            color: #f9e0c0;
                        }

                        .line2 {
                            font-size: 12px;
                            line-height: 14px;
                            vertical-align: middle;
                            color: #f9e0c0;

                            .u-icon-ucenter-arrow {
                                background-image: url(//yanxuan-static.nosdn.127.net/hxm/yanxuan-mall-wap/assets/img/ucenter-11eb865ad061b2dd08d2ec54d87461d6.png);
                                display: inline-block;
                                vertical-align: middle;
                                background-size: 3.21rem 2.78rem;
                                width: 9px;
                                height: 9px;
                                background-position: -2.87rem -0.48rem;
                                margin: -2px 0 0 2px;
                            }
                        }
                    }
                }

            }
        }

    }

    //我的资产
    .myassets {
        background: #fff;
        border-bottom: 12px solid #f4f4f4;

        .tt {
            font-size: 14px;
            color: #333;
            text-align: left;
            line-height: 52.67px;
            margin: 0 0 0 15px;
            border-bottom: 1px solid #d9d9d9;
        }

        .assetslist {
            display: flex;
            position: relative;
            display: -ms-flexbox;
            display: flex;
            -webkit-box-pack: justify;
            justify-content: space-between;
            text-align: center;

            .assetsitem {
                position: relative;
                padding-top: 16px;
                height: 60px;
                flex-shrink: 0;
                -webkit-box-flex: 1;
                flex-grow: 1;

                .assetCount {
                    height: 18px;
                    font-size: 16px;
                    margin: 0 0 2px 0;
                    font-weight: 700;

                    .unit {
                        margin-right: 2px;
                        font-size: 12px;
                        line-height: 14px;
                    }

                    .value {
                        position: relative;
                        margin: 0 0;
                        font-size: 16px;
                        line-height: 19.33px;

                        .redDot {
                            width: 7px;
                            height: 7px;
                            position: absolute;
                            top: -2px;
                            right: -6px;
                            border-radius: 50%;
                            background-color: #dd1a21;
                        }
                    }

                }

                .assetName {
                    margin: 0 0;
                    font-size: 12px;
                    line-height: 18px;
                }
            }
        }
    }

    //订单列表
    .personal_center {
        background: #fff;
        color: #333;
        margin-bottom: 15px;
      }

    //退出登录
    .row {
        .button {
            display: block;
            width: 100%;
            height: 60px;
            line-height: 30px;
            border: 1px solid #fff;
            background-color: #fff;
            color: #333;
            font-size: 14px;
            border-bottom: 15px solid #eee;
        }
    }

}</style>
